<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>ModalAPI</title>
    <link rel="stylesheet" href="../css/bootstrap.min.css">
    <link rel="stylesheet" href="../css/bootstrapEx.css">
    <link rel="stylesheet" href="../js/prettyPrint/css/prettify.css">
    <link rel="stylesheet" href="api.css">


    <script src="../js/jquery-1.9.1.min.js"></script>
    <script type="text/javascript" src="../js/bootstrap.min.js"></script>
    <script type="text/javascript" src="../js/prettyPrint/js/prettify.js"></script>
</head>

<body onload="prettyPrint()">
    <div class="container-fluid">
        <div class="">
            <div class="span12">
                <h1>属性</h1>
                <hr/>
            </div>
            <div class="">
                <h3>bsEx.Confirm </h3>
                添加引用
                <pre class="prettyprint linenums"><code> &lt;link rel=&quot;stylesheet&quot; href=&quot;../../css/bootstrap.min.css&quot;&gt;
 &lt;link rel=&quot;stylesheet&quot; href=&quot;../../css/bootstrapEx.css&quot;&gt;
 
 &lt;script src=&quot;../../js/jquery-1.9.1.min.js&quot;&gt;&lt;/script&gt;
 &lt;script type=&quot;text/javascript&quot; src=&quot;../../js/bootstrap.min.js&quot;&gt;&lt;/script&gt;
 &lt;script type=&quot;text/javascript&quot; src=&quot;../../js/bootstrapEx2.0.js&quot;&gt;&lt;/script&gt;</code></pre>
                <p>继承自bsEx.ui.Modal:</p>
                <h4>示例</h4>
                <pre class="prettyprint linenums"><code>bsEx.Confirm("提示","是否确认删除",function(t){
    t.hide();
    bsEx.Alert("提示","删除成功",2);
})</code> </pre>
                <hr/>
            </div>
        </div>
        <div class="">
            <div class="span12">
                <h1>方法</h1>
                <hr/>
            </div>
            <div class="">
                <h3>Confirm()<small>本身就是一级方法，所以通过实例介绍参数</small></h3>
                <p></p>
                <h4>示例</h4>
                <pre class="prettyprint linenums"><code>//三个参数，标题，提示内容，确定按钮事件(当前提示框实例t，确认按钮实例btn)
bsEx.Confirm("提示","是否确认删除",function(t,btn){
    //1秒后重置按钮 关闭确认框
    btn.loading().delay(1000).queue(function() {
        btn.reset();
        $(this).dequeue();
        t.hide();
        bsEx.Alert("提示","删除成功",2);
    });
});

//四个参数，标题，提示内容，确定按钮事件(当前提示框实例t，确认按钮实例btn)，取消按钮事件(当前提示框实例t，确认按钮实例btn)
$("#btn2").click(function () {
    bsEx.Confirm("提示","是否确认删除",function(t,btn){
        btn.loading().delay(1000).queue(function() {
            btn.reset();
            $(this).dequeue();
            t.hide();
            bsEx.Alert("提示","删除成功",2);
        });
    },function(){
        bsEx.Alert("提示","取消删除",2);
    })
});

//弹出确认框，自定义按钮
$("#btn3").click(function () {
    bsEx.Confirm("提示","是否确认删除",[
        {"text":"还不确定","id":"btn3_1"},
        {"text":"再想想","id":"btn3_2"},
        {"text":"算了","id":"btn3_3"}
    ])
});
                </code> </pre>
                <hr/>
            </div>
        </div>
</body>
<script>
      $(document).ready(function () {
          $.each($(".table").find(".row div"),function(i,t){
              $(t).removeClass("col-xs-3 col-sm-3");
          });
          $.each($(".table").find(".row"),function(i,t){
              $(t).find("div").eq(0).addClass("col-xs-2 col-sm-2");
              $(t).find("div").eq(1).addClass("col-xs-2 col-sm-2");
              $(t).find("div").eq(2).addClass("col-xs-3 col-sm-3");
              $(t).find("div").eq(3).addClass("col-xs-5 col-sm-5");
          });
      });
</script>
</html>